//
//  NSString+Common.h
//  Tools
//
//  Created by han on 2019/2/14.
//  Copyright © 2019 han. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSString (Common)

// 非空
- (BOOL)isEmpty;

//去掉字符串两端的空格和换行
- (NSString *)stringByTrimming;
//去掉字符串的空格和换行
- (NSString *)stringByTrimmingExtraSpaces;

//加密
- (NSString *)stringByMd5;
- (NSString *)stringBySha1;

//计算size
- (CGSize)getSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size;
- (CGFloat)getHeightWithFont:(UIFont *)font constrainedToSize:(CGSize)size;
- (CGFloat)getWidthWithFont:(UIFont *)font constrainedToSize:(CGSize)size;

// attribute
- (NSAttributedString *)attributeStringWithColor:(UIColor *)color;
- (NSAttributedString *)attributeStringWithColor:(UIColor *)color keywords:(NSArray *)keywords keywordsColor:(UIColor *)keywordsColor;

// 是否手机号码
- (BOOL)isPhoneNO;


@end

NS_ASSUME_NONNULL_END
